import request from '@/utils/request'

// export const loginApi = data => request.post('http://localhost:8888/api/sys/login', data)
// 发送登录请求
export const loginApi = (data) => {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

/**
 * 获取用户信息
 * @returns
 */
export const getUserInfoApi = () => {
  return request.post('/sys/profile')
}

/**
 * 获取用户的基本信息，包含头像
 * @param {*} id 用户id
 * @returns
 */
export const getBaseUserInfoApi = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}
